package cn.legend.travel.admin.destination.pojo.entity;

import cn.legend.travel.admin.destination.pojo.param.SceneryUpdateParam;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@TableName("destination_scenery_table")
public class Scenery implements Serializable {

    /**
     * 数据ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 名称
     */
    private String name;
    /**
     * 经纬度
     */
    private String location;
    /**
     * 收藏数量
     */
    private Long collectionCount;
    /**
     * 简介
     */
    private String brief;

    /**
     * 浏览数量
     */
    private Long viewCount;
    /**
     * 目的地ID
     */
    private Long destinationId;
    private Integer enable;
    private Integer isDisplay;
    /**
     * 封面图url
     */
    private String coverUrl;
    /**
     * 数据创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    LocalDateTime gmtCreate;

    /**
     * 数据最后修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    LocalDateTime gmtModified;

    public Scenery() {
    }

    public Scenery(SceneryUpdateParam param) {
        id = param.getId();
        name = param.getName();
        location = param.getLocation();
        brief = param.getBrief();
        enable = param.getEnable();
        isDisplay = param.getIsDisplay();
        coverUrl = param.getCoverUrl();
    }
}
